/*
 * Copyright (c) 2011 All Rights Reserved.
 */
package com.becca.cake.dao.system;

import java.util.List;
import java.util.Map;

import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Repository;

import com.becca.cake.model.system.AdminDO;
import com.becca.cake.model.system.AdminSubscriberSettingDO;

/**
 * 员工管理Dao
 * @author hejinguo
 * @version $Id: PriAdminDAO.java, v 0.1 2015-12-2 上午18:46:25
 */
@Repository
public interface AdminDAO {
    /**
     * 根据用户名查询 
     * @author hejinguo
     * @param name
     * @return
     * @throws DataAccessException
     */
    AdminDO selectAdminByName(String name) throws DataAccessException;

    /**
     * 修改员工密码
     * @author hejinguo
     * @param map
     * @throws DataAccessException
     */
    void updatePassWord(Map<String, Object> map) throws DataAccessException;

    /**
     * 查询全部员工信息
     * @author hejinguo
     * @param map
     * @return
     * @throws Exception
     */
    List<AdminDO> selectAllAdmin(Map<String, Object> map) throws DataAccessException;

    /**
     * 查询全部员工的总记录数
     * @author hejinguo
     * @param map
     * @return
     * @throws Exception
     */
    Long selectAllAdminCount(Map<String, Object> map) throws DataAccessException;

    /**
     * 根据角色ID查询该角色对应的人员
     * @author hejinguo
     * @param roleId
     * @return
     * @throws Exception
     */
    List<AdminDO> selectPersonnelByRoleId(Map<String, Object> map) throws DataAccessException;

    /**
     * 根据角色ID查询该角色对应的人员总记录数
     * @author hejinguo
     * @param roleId
     * @return
     * @throws Exception
     */
    Long selectPersonnelByRoleIdCount(Map<String, Object> map) throws DataAccessException;

    /**
     * 添加员工信息
     * @author hejinguo
     * @param adminDO
     * @throws Exception
     */
    void insertAdmin(AdminDO adminDO) throws DataAccessException;

    /**
     * 修改员工信息
     * @author hejinguo
     * @param adminDO
     * @throws DataAccessException
     */
    void updateAdmin(AdminDO adminDO) throws DataAccessException;

    /**
     * 根据ID查询员工信息
     * @author hejinguo
     * @param adminId
     * @return
     * @throws DataAccessException
     */
    AdminDO selectAdminById(String adminId) throws DataAccessException;

    /**
     * 查询当前员工名称是否存在
     * @author hejinguo
     * @param adminName
     * @return
     * @throws DataAccessException
     */
    String selectAdminNameExist(String adminName) throws DataAccessException;

    /**
     * 根据功能ID查询对应人员信息
     * @author hejinguo
     * @param functionId
     * @return
     * @throws DataAccessException
     */
    List<AdminDO> selectAdminByFunctionId(String functionId) throws DataAccessException;

    /**
     * 设置提醒类型
     * @param param
     * @throws Exception
     */
    void updatePriAdminSubscription(Map<String, Object> param) throws Exception;

    /**
     * 查询用户设置的分享类型
     * @param param
     * @return
     * @throws Exception
     */
    List<AdminSubscriberSettingDO> selectUserSubscript(Map<String, Object> param);

    /**
     * 删除人员提醒信息
     * @param userId
     * @throws DataAccessException
     */
    void deleteUserSubscriptByAdminId(Integer userId) throws DataAccessException;

    /**
     * 添加人员提醒
     * @param param
     * @throws DataAccessException
     */
    void insertUserSubscript(Map<String, Object> param) throws DataAccessException;
}